package com.open.capacity.forum.feign.impl;

import com.open.capacity.common.web.Result;
import com.open.capacity.forum.feign.FileService;
import com.open.capacity.forum.feign.UserCenterService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @author 蒋鑫
 * @version 2021/3/3
 * 更新用户称号远程调用服务降级
 */
@Slf4j
public class UserCentServiceFallback implements FallbackFactory<UserCenterService> {

    @Override
    public UserCenterService create(Throwable throwable) {
        return new UserCenterService() {
            @Override
            public Result updateTitleByUserIdAndPoints(Long userId, Double points, String typeCode) {
                return Result.failed("userCenter服务异常!");
            }
        };
    }
}
